#include using namespace std; void main() { double money; cout << "Money? "; cin >> money; //0-1000000000 money = money + .0050000001; //type cast (int) int x; int wholeMoney = (int)money; int cents = ((money - wholeMoney) * 100); int billions = wholeMoney / 1000000000; wholeMoney -= billions * 1000000000; int millions = wholeMoney / 1000000; wholeMoney -= millions * 1000000; int thousands = wholeMoney / 1000; wholeMoney -= thousands * 1000; int hundredsGroup = wholeMoney; cout << "billions = " << billions << endl; cout << "millions = " << millions << endl; cout << "thousands = " << thousands << endl; cout << "hundredsGroup = " << hundredsGroup << endl; cout << "cents = " << cents << endl; }